package com.jxdinfo.hussar.example.sbjx.equiprepair.controller;

import com.jxdinfo.hussar.support.mp.base.controller.HussarBaseController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.jxdinfo.hussar.support.audit.core.annotations.AuditLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.jxdinfo.hussar.support.audit.core.enums.AuditEventGrade;
import com.jxdinfo.hussar.support.audit.core.enums.AuditEventType;
import org.springframework.web.bind.annotation.PostMapping;
import com.jxdinfo.hussar.example.sbjx.equiprepair.model.EquipRepair;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Arrays;
import com.jxdinfo.hussar.example.sbjx.equiprepair.vo.EquipRepairPageVO;
import com.jxdinfo.hussar.example.sbjx.equiprepair.dto.EquipRepairSelectCondition;
import org.springframework.beans.factory.annotation.Autowired;
import com.jxdinfo.hussar.platform.core.base.apiresult.ApiResponse;
import org.springframework.web.bind.annotation.RequestBody;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
import com.jxdinfo.hussar.example.sbjx.equiprepair.service.EquipRepairService;
import org.springframework.web.bind.annotation.GetMapping;
import com.jxdinfo.hussar.example.sbjx.equiprepair.dto.EquipRepairEquiprepairdataset1;

/**
 * 设备检修表控制器
 */
@RestController(value = "sbjx.equiprepair.EquipRepairController")
@AuditLog(moduleName = "设备检修表")
@RequestMapping(value = "/sbjx/equipRepair")
public class EquipRepairController extends HussarBaseController<EquipRepair, EquipRepairService> {

    private static final Logger logger = LoggerFactory.getLogger(EquipRepairController.class);

    @Autowired
    private EquipRepairService equipRepairService;

    /**
     * 设备检修表新增或修改
     */
    @AuditLog(moduleName = "设备检修表", eventDesc = "新增或修改", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.INSERT)
    @PostMapping("insertOrUpdate")
    public ApiResponse<String> insertOrUpdate(@RequestBody EquipRepair equipRepair) {
        return equipRepairService.insertOrUpdate(equipRepair);
    }

    /**
     * 设备检修表表单查询
     */
    @AuditLog(moduleName = "设备检修表", eventDesc = "表单查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @GetMapping("formQuery")
    public ApiResponse<EquipRepair> formQuery(@RequestParam(value = "id") String id) {
        return equipRepairService.formQuery(id);
    }

    /**
     * 设备检修表表格查询（带分页）
     *
     * @param page 分页对象
     * @return 查询结果
     */
    @AuditLog(moduleName = "设备检修表", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("hussarQueryPage")
    public ApiResponse<EquipRepairPageVO> hussarQueryPage(@RequestBody Page<EquipRepair> page) {
        return equipRepairService.hussarQueryPage(page);
    }

    /**
     * 设备检修表表格查询（带分页）
     *
     * @param page 分页对象
     * @return 查询结果
     */
    @AuditLog(moduleName = "设备检修表", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("hussarQueryPage_order_custom")
    public ApiResponse<EquipRepairPageVO> hussarQueryPage_order_custom(@RequestBody Page<EquipRepair> page) {
        return equipRepairService.hussarQueryPage_order_custom(page);
    }

    /**
     * 设备检修表表格批量物理删除
     *
     * @param ids id数组
     * @return 删除成功标识
     */
    @AuditLog(moduleName = "设备检修表", eventDesc = "批量物理删除", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.DELETE)
    @PostMapping("del")
    public ApiResponse<Boolean> del(@RequestParam(value = "ids") String[] ids) {
        return equipRepairService.del(Arrays.asList(ids));
    }

    /**
     * 设备检修表表格查询（带分页）
     *
     * @param equiprepairdataset1 查询对象
     * @return 查询结果
     */
    @AuditLog(moduleName = "设备检修表", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("hussarQueryequipRepairCondition_1Page")
    public ApiResponse<EquipRepairPageVO> hussarQueryequipRepairCondition_1Page(@RequestBody EquipRepairEquiprepairdataset1 equiprepairdataset1) {
        return equipRepairService.hussarQueryequipRepairCondition_1Page(equiprepairdataset1);
    }

    /**
     * 设备检修表表格查询（带分页）
     *
     * @param equiprepairdataset1 查询对象
     * @return 查询结果
     */
    @AuditLog(moduleName = "设备检修表", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("hussarQueryequipRepairCondition_1Page_order_custom")
    public ApiResponse<EquipRepairPageVO> hussarQueryequipRepairCondition_1Page_order_custom(@RequestBody EquipRepairEquiprepairdataset1 equiprepairdataset1) {
        return equipRepairService.hussarQueryequipRepairCondition_1Page_order_custom(equiprepairdataset1);
    }

    /**
     * 设备检修表表格自定义查询（带分页）
     *
     * @return 查询结果
     */
    @AuditLog(moduleName = "设备检修表", eventDesc = "表格自定义查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("ConditionFilterPage")
    public ApiResponse<EquipRepairPageVO> ConditionFilterPage(@RequestBody EquipRepairSelectCondition equipRepairSelectCondition) {
        return equipRepairService.ConditionFilterPage(equipRepairSelectCondition);
    }

    /**
     * 设备检修表表格自定义查询（带分页）
     *
     * @return 查询结果
     */
    @AuditLog(moduleName = "设备检修表", eventDesc = "表格自定义查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("ConditionFilterPage_order_custom")
    public ApiResponse<EquipRepairPageVO> ConditionFilterPage_order_custom(@RequestBody EquipRepairSelectCondition equipRepairSelectCondition) {
        return equipRepairService.ConditionFilterPage_order_custom(equipRepairSelectCondition);
    }

    /**
     * 设备检修表表格自定义查询（带分页）
     *
     * @return 查询结果
     */
    @AuditLog(moduleName = "设备检修表", eventDesc = "表格自定义查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("ConditionFilterequipRepairCondition_2Page")
    public ApiResponse<EquipRepairPageVO> ConditionFilterequipRepairCondition_2Page(@RequestBody EquipRepairSelectCondition equipRepairSelectCondition) {
        return equipRepairService.ConditionFilterequipRepairCondition_2Page(equipRepairSelectCondition);
    }

    /**
     * 设备检修表表格自定义查询（带分页）
     *
     * @return 查询结果
     */
    @AuditLog(moduleName = "设备检修表", eventDesc = "表格自定义查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("ConditionFilterequipRepairCondition_2Page_order_custom")
    public ApiResponse<EquipRepairPageVO> ConditionFilterequipRepairCondition_2Page_order_custom(@RequestBody EquipRepairSelectCondition equipRepairSelectCondition) {
        return equipRepairService.ConditionFilterequipRepairCondition_2Page_order_custom(equipRepairSelectCondition);
    }

    /**
     * 设备检修表表格查询
     *
     * @return 查询结果
     */
    @AuditLog(moduleName = "设备检修表", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("hussarQuery")
    public ApiResponse<EquipRepairPageVO> hussarQuery() {
        return equipRepairService.hussarQuery();
    }
}
